﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChietTinhBaoHiem.aspx.cs" Inherits="DLV.BackEnd.Pages.ChietTinhBaoHiem" %>

<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="DLV.Data.Entities" %>
<%@ Import Namespace="DLV.Library.Utilities" %>

<asp:content id="Content1" contentplaceholderid="placeHolderContent" runat="server">
    <style>
        .report {
            margin-top: 40px;
        }

        .head {
            width: 100%;
            overflow: hidden;
        }

            .head > .logo {
                width: 20%;
                float: left;
                margin-right: 1%;
            }

                .head > .logo img {
                    display: block;
                    margin: 0 auto;
                }

            .head > .table {
                width: 78%;
                float: right;
            }

                .head > .table > table {
                    width: 100%;
                    border-top: 1px solid #000;
                    border-left: 1px solid #000;
                }

                    .head > .table > table th {
                        padding: 10px 0;
                        font-size: 20px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                        background-color: #F2DCDB;
                    }

                    .head > .table > table td {
                        padding: 7px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                    }

        .service {
            width: 100%;
            margin-top: 20px;
        }

            .service > table {
                width: 100%;
                margin-bottom: 20px;
                border-top: 1px solid #000;
                border-left: 1px solid #000;
            }

                .service > table th {
                    padding: 5px 0;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                    background-color: #F2DCDB;
                }

                    .service > table th.first {
                        background-color: #92CDDC;
                        width: 8%;
                    }

                .service > table td {
                    padding: 7px;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                }

                .service > table .tr {
                    text-align: right;
                }

        div {
            margin: 0;
            padding: 0;
        }
    </style>
    
    <div class="report">
        <div class="head">
            <div class="logo">
                <a href="http://dulichviet.com.vn"><img src="/images/logo.png" /></a>
            </div>    
            <div class="table">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <th colspan="4">BẢNG TÍNH GIÁ</th>
                    </tr>
                    <tr>
                        <td><b>Tên đoàn</b></td>
                        <td><%=tourInfo.TourName%></td>
                        <td><b>Code đoàn</b></td>
                        <td>DLV<%=tourInfo.TourId%></td>
                    </tr>
                    <tr>
                        <td><b>Loại hình đoàn</b></td>
                        <td><%=tourInfo.GroupType%></td>
                        <td><b>Loại tour</b></td>
                        <td><%=tourInfo.TourTypeId%></td>
                    </tr>
                    <tr>
                        <td><b>Điểm khởi hành</b></td>
                        <td><%=tourInfo.LocationBegin%></td>
                        <td><b>Hành trình</b></td>
                        <td><%=tourInfo.ScheduleId%></td>
                    </tr>
                    <tr>
                        <td><b>Số lượng khách</b></td>
                        <td>Người lớn: <%=tourInfo.QuantityAdult%> | Trẻ em: <%=tourInfo.QuantityChild%></td>
                        <td><b>Đối tượng khách</b></td>
                        <td>Chọn đối tượng khách</td>
                    </tr>
                    <tr>
                        <td><b>Số hướng dẫn viên</b></td>
                        <td>Chọn số</td>
                        <td><b>Yêu cầu</b></td>
                        <td>Chọn loại HDV</td>
                    </tr>
                    <tr>
                        <td><b>Ngày khởi hành</b></td>
                        <td><%=tourInfo.BeginDate%></td>
                        <td><b>Ngày kết thúc</b></td>
                        <td><%=tourInfo.EndDate%></td>
                    </tr>
                    <tr>
                        <td><b>Tổng số ngày</b></td>
                        <td><%=tourInfo.QuantityDay%></td>
                        <td><b>Tổng số đêm</b></td>
                        <td><%=tourInfo.QuantityNight%></td>
                    </tr>
                     <tr>
                        <td><b>Mùa</b></td>
                        <td><%=tourInfo.Season%></td>
                        <td><b>Thị trường</b></td>
                        <td><%=tourInfo.MartName%></td>
                    </tr>
                </table>
            </div>
        </div>
        
         <%--KHÁCH SẠN--%>
           <div class="service">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <th rowspan="2" class="first">BẢO HIỂM</th>
                    <th rowspan="2">NHÀ CUNG CẤP</th>
                    <th rowspan="2">BẢO HIỂM</th>
                    <th rowspan="2">NGÀY BẮT ĐẦU</th>
                    <th rowspan="2">NGÀY HẾT HẠN</th>
                    <th rowspan="2">SỐ NGÀY BH</th>
                    <th colspan="2">CHI PHÍ</th>
                    <th colspan="2">SỐ KHÁCH</th>
                    <th rowspan="2">VAT</th>
                    <th rowspan="2">TỔNG</th>
                    <th rowspan="2">GHI CHU</th>
                    <th rowspan="2"></th>
                </tr>
                <tr>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                </tr>

                <% foreach (DLV.Data.Entities.CalculatorInfo calculatorInsurance in InsuranceList)
                   { %>
                <tr class="ListInsurance" id="Insurance-<%=calculatorInsurance.CalculatorId%>">
                    <td></td>
                    <td><%=calculatorInsurance.PartnerName%></td>
                    <td><%=calculatorInsurance.InsuranceName%></td>
                    <td><%=calculatorInsurance.DateBegin.ToShortDateString()%></td>
                    <td><%=calculatorInsurance.DateEnd.ToShortDateString()%></td>
                    <td><%=calculatorInsurance.CountNightHotel+1%></td>
                    <td><%=calculatorInsurance.PriceAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorInsurance.PriceChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorInsurance.QuantityAdults%></td>
                    <td><%=calculatorInsurance.QuantityChild%></td>
                    <td><%=calculatorInsurance.Vat%></td>
                    <td><%=(calculatorInsurance.TotalPriceInsuranceAdults+calculatorInsurance.TotalPriceInsuranceChild).ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td></td>
                    <td>
                        <input class="btnUpdateInsurance"  type="button" value="Cập nhật" calculatorid="<%=calculatorInsurance.CalculatorId%>" />
                        <input class="btnDeleteInsurance"  type="button" value="Xóa" calculatorid="<%=calculatorInsurance.CalculatorId%>" />
                    </td>
                </tr>
                
                <%} %>
                <tr></tr>
                 <tr id="new-ticket-insurance">
                    <td></td>
                    <td><asp:DropDownList ID="ddlPartnerInsurance" runat="server" Width="170px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlInsurance" runat="server" Width="170px"></asp:DropDownList></td>
                    <td><input type="text" id="dteBeginDateInsurance" style="width:100px;" placeholder="Clic chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><input type="text" id="dteEndDateInsurance" style="width:100px;" placeholder="Click chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><asp:Label runat="server" ID="lbCountNightInsurance"></asp:Label></td>
                    <td><asp:TextBox id="txtPriceAdultInsurance" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtPriceChildInsurance" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityAdultInsurance" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityChildInsurance" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox ID="txtVATInsurance" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:Label id="lbTotalPriceInsurance" runat="server" Width="50px"></asp:Label></td>
                    <td></td>
                    <td id="toolbar-save" class="button">
						 <input  id="btnInsertInsurance" class="btnsave" type="button" value="Thêm" calculatorid="-1"/>
                        <input id="btnDeleteInsurance" class="btnDeleteInsurance"  type="button" value="Hủy" calculatorid="-1" />
					</td>
                </tr>
                <tr>
                    <td colspan="11"><b>TỔNG CHI PHÍ ĐOÀN</b></td>
                    <td class="tr" id="TotalInsurancePrices"><%=TotalInsurancePrices.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="11"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                    <td class="tr" id="TotalInsurancePricesAdults"><%=TotalInsurancePricesAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="11"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                    <td class="tr" id="TotalInsurancePricesChild"><%=TotalInsurancePricesChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td></td>   
                </tr>
 
        </table>
               
               </div>

    </div>
    <link rel="stylesheet" href="/css/datepicker/jquery.ui.all.css" />
	<script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="/js/ui/jquery.ui.datepicker.js"></script>
	<script type="text/javascript">
	    $(function () {
	        $("#<%= dteBeginDateInsurance.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });


	        $("#<%= dteEndDateInsurance.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });
	    });
	</script>
    

    <script src="/js/jquery.address.js"></script>
    <script src="/js/jquery.ChietTinhBaoHiem.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            InsertCalculatorInsurance('#<%=ddlPartnerInsurance.ClientID%>', '#<%=ddlInsurance.ClientID%>', '#<%=dteBeginDateInsurance.ClientID%>', '#<%=dteEndDateInsurance.ClientID%>', '#<%=lbCountNightInsurance.ClientID%>', '#<%=txtPriceAdultInsurance.ClientID%>', '#<%=txtPriceChildInsurance.ClientID%>', '#<%=txtQuantityAdultInsurance.ClientID%>', '#<%=txtQuantityChildInsurance.ClientID%>', '#<%=txtVATInsurance.ClientID%>', '#<%=lbTotalPriceInsurance.ClientID%>','<%=tourInfo.TourId%>');
        });
    </script>
</asp:content>

